home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / text.n < prev    next >
Text File  |  1995-07-25  |  59KB  |  1,056 lines

  1.  
  2.  
  3.  
  4.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           text - Create and manipulate text widgets
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           tttteeeexxxxtttt _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16.      SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  17.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ffffoooorrrreeeeggggrrrroooouuuunnnndddd     iiiinnnnsssseeeerrrrttttWWWWiiiiddddtttthhhh     sssseeeelllleeeeccccttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh
  18.           bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     iiiinnnnsssseeeerrrrttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               ppppaaaaddddXXXXsssseeeelllleeeeccccttttFFFFoooorrrreeeeggggrrrroooouuuunnnndddd
  19.           ccccuuuurrrrssssoooorrrr          iiiinnnnsssseeeerrrrttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh              ppppaaaaddddYYYYsssseeeettttGGGGrrrriiiidddd
  20.           eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn iiiinnnnsssseeeerrrrttttOOOOffffffffTTTTiiiimmmmeeee  rrrreeeelllliiiieeeeffff          yyyySSSSccccrrrroooollllllllCCCCoooommmmmmmmaaaannnndddd
  21.           ffffoooonnnntttt            iiiinnnnsssseeeerrrrttttOOOOnnnnTTTTiiiimmmmeeee   sssseeeelllleeeeccccttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd
  22.  
  23.           See the ``options'' manual entry for details on the standard
  24.           options.
  25.  
  26.      WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  27.           Name:           hhhheeeeiiiigggghhhhtttt
  28.           Class:          HHHHeeeeiiiigggghhhhtttt
  29.           Command-Line Switch:           ----hhhheeeeiiiigggghhhhtttt
  30.  
  31.                Specifies the desired height for the window,  in  units
  32.                of characters.  Must be at least one.
  33.  
  34.           Name:           ssssttttaaaatttteeee
  35.           Class:          SSSSttttaaaatttteeee
  36.           Command-Line Switch:           ----ssssttttaaaatttteeee
  37.  
  38.                Specifies one of two states for the  text:   nnnnoooorrrrmmmmaaaallll  or
  39.                ddddiiiissssaaaabbbblllleeeedddd.   If the text is disabled then characters may
  40.                not be inserted or deleted and no insertion cursor will
  41.                be displayed, even if the input focus is in the widget.
  42.  
  43.           Name:           wwwwiiiiddddtttthhhh
  44.           Class:          WWWWiiiiddddtttthhhh
  45.           Command-Line Switch:           ----wwwwiiiiddddtttthhhh
  46.  
  47.                Specifies the desired width for the window in units  of
  48.                characters.   If  the font doesn't have a uniform width
  49.                then the width  of  the  character  ``0''  is  used  in
  50.                translating from character units to screen units.
  51.  
  52.           Name:           wwwwrrrraaaapppp
  53.           Class:          WWWWrrrraaaapppp
  54.           Command-Line Switch:           ----wwwwrrrraaaapppp
  55.  
  56.                Specifies how to handle lines in the text that are  too
  57.                long  to  be  displayed  in a single line of the text's
  58.                window.  The value must be nnnnoooonnnneeee or  cccchhhhaaaarrrr  or  wwwwoooorrrrdddd.   A
  59.                wrap  mode of nnnnoooonnnneeee means that each line of text appears
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  71.  
  72.  
  73.  
  74.                as exactly one line on the  screen;   extra  characters
  75.                that don't fit on the screen are not displayed.  In the
  76.                other modes each line of text will be  broken  up  into
  77.                several  screen  lines  if  necessary  to  keep all the
  78.                characters visible.  In cccchhhhaaaarrrr mode a screen  line  break
  79.                may  occur  after  any  character;  in wwwwoooorrrrdddd mode a line
  80.                break will only be made at word boundaries.
  81.      _________________________________________________________________
  82.  
  83.  
  84.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  85.           The tttteeeexxxxtttt command creates a new window (given by the _p_a_t_h_N_a_m_e
  86.           argument)  and  makes  it  into  a  text widget.  Additional
  87.           options, described above, may be specified  on  the  command
  88.           line  or  in the option database to configure aspects of the
  89.           text such as its default background color and  relief.   The
  90.           tttteeeexxxxtttt command returns the path name of the new window.
  91.  
  92.           A text widget displays one or more lines of text and  allows
  93.           that   text  to  be  edited.   Text  widgets  support  three
  94.           different kinds of annotations on  the  text,  called  tags,
  95.           marks,  and  windows.   Tags allow different portions of the
  96.           text to be displayed with different fonts  and  colors.   In
  97.           addition,  Tcl  commands can be associated with tags so that
  98.           commands  are  invoked  when  particular  actions  such   as
  99.           keystrokes  and  mouse  button  presses  occur in particular
  100.           ranges of the text.  See TAGS below for more details.
  101.  
  102.           The second form of annotation consists of marks,  which  are
  103.           floating  markers in the text.  Marks are used to keep track
  104.           of various interesting  positions  in  the  text  as  it  is
  105.           edited.  See MARKS below for more details.
  106.  
  107.           The third form of annotation allows arbitrary windows to  be
  108.           displayed  in  the  text widget.  See WINDOWS below for more
  109.           details.
  110.  
  111.  
  112.      IIIINNNNDDDDIIIICCCCEEEESSSS
  113.           Many of the widget commands  for  texts  take  one  or  more
  114.           indices as arguments.  An index is a string used to indicate
  115.           a particular place within a text, such as a place to  insert
  116.           characters  or  one  endpoint  of  a  range of characters to
  117.           delete.  Indices have the syntax
  118.  
  119.                _b_a_s_e _m_o_d_i_f_i_e_r _m_o_d_i_f_i_e_r _m_o_d_i_f_i_e_r ...
  120.  
  121.           Where _b_a_s_e gives a starting point and the  _m_o_d_i_f_i_e_rs  adjust
  122.           the  index  from  the  starting  point (e.g. move forward or
  123.           backward one character).  Every index must contain  a  _b_a_s_e,
  124.           but the _m_o_d_i_f_i_e_rs are optional.
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  137.  
  138.  
  139.  
  140.           The _b_a_s_e for an index must have one of the following forms:
  141.  
  142.           _l_i_n_e...._c_h_a_r   Indicates _c_h_a_r'th character on line _l_i_n_e.  Lines
  143.                       are  numbered  from 1 for consistency with other
  144.                       UNIX programs that use  this  numbering  scheme.
  145.                       Within a line, characters are numbered from 0.
  146.  
  147.           @@@@_x,,,,_y        Indicates the character that  covers  the  pixel
  148.                       whose  x  and  y  coordinates  within the text's
  149.                       window are _x and _y.
  150.  
  151.           eeeennnndddd         Indicates the last character in the text,  which
  152.                       is always a newline character.
  153.  
  154.           _m_a_r_k        Indicates the  character  just  after  the  mark
  155.                       whose name is _m_a_r_k.
  156.  
  157.           _t_a_g....ffffiiiirrrrsssstttt   Indicates the first character in the  text  that
  158.                       has  been  tagged with _t_a_g.  This form generates
  159.                       an error if no characters are  currently  tagged
  160.                       with _t_a_g.
  161.  
  162.           _t_a_g....llllaaaasssstttt    Indicates the character just after the last  one
  163.                       in the text that has been tagged with _t_a_g.  This
  164.                       form generates an error  if  no  characters  are
  165.                       currently tagged with _t_a_g.
  166.  
  167.           If modifiers follow the base index, each one  of  them  must
  168.           have  one of the forms listed below.  Keywords such as cccchhhhaaaarrrrssss
  169.           and wwwwoooorrrrddddeeeennnndddd may be abbreviated as long as  the  abbreviation
  170.           is unambiguous.
  171.  
  172.           ++++ _c_o_u_n_t cccchhhhaaaarrrrssss
  173.                Adjust the index forward by _c_o_u_n_t characters, moving to
  174.                later  lines  in  the  text if necessary.  If there are
  175.                fewer than _c_o_u_n_t  characters  in  the  text  after  the
  176.                current index, then set the index to the last character
  177.                in the text.   Spaces  on  either  side  of  _c_o_u_n_t  are
  178.                optional.
  179.  
  180.           ---- _c_o_u_n_t cccchhhhaaaarrrrssss
  181.                Adjust the index backward by _c_o_u_n_t  characters,  moving
  182.                to  earlier  lines  in the text if necessary.  If there
  183.                are fewer than _c_o_u_n_t characters in the text before  the
  184.                current   index,  then  set  the  index  to  the  first
  185.                character in the text.  Spaces on either side of  _c_o_u_n_t
  186.                are optional.
  187.  
  188.           ++++ _c_o_u_n_t lllliiiinnnneeeessss
  189.                Adjust the index forward by _c_o_u_n_t lines, retaining  the
  190.                same  character position within the line.  If there are
  191.                fewer than _c_o_u_n_t lines after the  line  containing  the
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/23/95)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  203.  
  204.  
  205.  
  206.                current  index, then set the index to refer to the same
  207.                character position on the last line of the text.  Then,
  208.                if  the  line is not long enough to contain a character
  209.                at  the  indicated  character  position,   adjust   the
  210.                character  position  to  refer to the last character of
  211.                the line (the newline).  Spaces on either side of _c_o_u_n_t
  212.                are optional.
  213.  
  214.           ---- _c_o_u_n_t lllliiiinnnneeeessss
  215.                Adjust the index backward by _c_o_u_n_t lines, retaining the
  216.                same  character position within the line.  If there are
  217.                fewer than _c_o_u_n_t lines before the line  containing  the
  218.                current  index, then set the index to refer to the same
  219.                character position on  the  first  line  of  the  text.
  220.                Then,  if  the  line  is  not  long enough to contain a
  221.                character at the indicated character  position,  adjust
  222.                the  character  position to refer to the last character
  223.                of the line (the newline).  Spaces on  either  side  of
  224.                _c_o_u_n_t are optional.
  225.  
  226.           lllliiiinnnneeeessssttttaaaarrrrtttt
  227.                Adjust the index to refer to the first character on the
  228.                line.
  229.  
  230.           lllliiiinnnneeeeeeeennnndddd
  231.                Adjust the index to refer to the last character on  the
  232.                line (the newline).
  233.  
  234.           wwwwoooorrrrddddssssttttaaaarrrrtttt
  235.                Adjust the index to refer to the first character of the
  236.                word  containing the current index.  A word consists of
  237.                any number of adjacent  characters  that  are  letters,
  238.                digits,  or  underscores, or a single character that is
  239.                not one of these.
  240.  
  241.           wwwwoooorrrrddddeeeennnndddd
  242.                Adjust the index to refer to the character  just  after
  243.                the  last one of the word containing the current index.
  244.                If the current index refers to the  last  character  of
  245.                the text then it is not modified.
  246.  
  247.           If more than one modifier is present then they  are  applied
  248.           in  left-to-right  order.   For example, the index ``eeeennnndddd ---- 1111
  249.           cccchhhhaaaarrrrssss'' refers to the next-to-last character in the text and
  250.           ``iiiinnnnsssseeeerrrrtttt  wwwwoooorrrrddddssssttttaaaarrrrtttt  ----  1111  cccc''  refers to the character just
  251.           before the first one in the word  containing  the  insertion
  252.           cursor.
  253.  
  254.  
  255.      TTTTAAAAGGGGSSSS
  256.           The first form of annotation in text widgets is  a  tag.   A
  257.           tag  is a textual string that is associated with some of the
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 7/23/95)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  269.  
  270.  
  271.  
  272.           characters in a text.  There  may  be  any  number  of  tags
  273.           associated with characters in a text.  Each tag may refer to
  274.           a single character, a range of characters, or several ranges
  275.           of  characters.  An individual character may have any number
  276.           of tags associated with it.
  277.  
  278.           A priority order is defined among tags, and  this  order  is
  279.           used  in  implementing  some  of  the  tag-related functions
  280.           described below.  When a tag is defined (by  associating  it
  281.           with  characters  or  setting its display options or binding
  282.           commands to it), it is given  a  priority  higher  than  any
  283.           existing  tag.   The priority order of tags may be redefined
  284.           using the ``_p_a_t_h_N_a_m_e ttttaaaagggg rrrraaaaiiiisssseeee'' and ``_p_a_t_h_N_a_m_e ttttaaaagggg  lllloooowwwweeeerrrr''
  285.           widget commands.
  286.  
  287.           Tags serve three purposes  in  text  widgets.   First,  they
  288.           control  the way information is displayed on the screen.  By
  289.           default, characters  are  displayed  as  determined  by  the
  290.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd,  ffffoooonnnntttt,  and  ffffoooorrrreeeeggggrrrroooouuuunnnndddd  options  for  the  text
  291.           widget.  However, display options  may  be  associated  with
  292.           individual  tags using the ``_p_a_t_h_N_a_m_e ttttaaaagggg ccccoooonnnnffffiiiigggguuuurrrreeee'' widget
  293.           command.  If a character has been tagged, then  the  display
  294.           options associated with the tag override the default display
  295.           style.  The following options are  currently  supported  for
  296.           tags:
  297.  
  298.           ----bbbbaaaacccckkkkggggrrrroooouuuunnnndddd _c_o_l_o_r
  299.                _C_o_l_o_r  specifies  the  background  color  to  use   for
  300.                characters associated with the tag.  It may have any of
  301.                the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr.
  302.  
  303.           ----bbbbggggssssttttiiiipppppppplllleeee _b_i_t_m_a_p
  304.                _B_i_t_m_a_p specifies a bitmap that is  used  as  a  stipple
  305.                pattern  for  the  background.   It may have any of the
  306.                forms accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp.  If _b_i_t_m_a_p hasn't  been
  307.                specified,  or  if  it is specified as an empty string,
  308.                then a solid fill will be used for the background.
  309.  
  310.           ----bbbboooorrrrddddeeeerrrrwwwwiiiiddddtttthhhh _p_i_x_e_l_s
  311.                _P_i_x_e_l_s specifies the width of  a  3-D  border  to  draw
  312.                around  the  background.   It may have any of the forms
  313.                accepted by  TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss.   This  option  is  used  in
  314.                conjunction  with  the  ----rrrreeeelllliiiieeeeffff  option  to  give a 3-D
  315.                appearance to the  background  for  characters;  it  is
  316.                ignored  unless the ----bbbbaaaacccckkkkggggrrrroooouuuunnnndddd option has been set for
  317.                the tag.
  318.  
  319.           ----ffffggggssssttttiiiipppppppplllleeee _b_i_t_m_a_p
  320.                _B_i_t_m_a_p specifies a bitmap that is  used  as  a  stipple
  321.                pattern   when   drawing   text  and  other  foreground
  322.                information such as underlines.  It may have any of the
  323.                forms  accepted by TTTTkkkk____GGGGeeeettttBBBBiiiittttmmmmaaaapppp.  If _b_i_t_m_a_p hasn't been
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 7/23/95)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  335.  
  336.  
  337.  
  338.                specified, or if it is specified as  an  empty  string,
  339.                then a solid fill will be used.
  340.  
  341.           ----ffffoooonnnntttt _f_o_n_t_N_a_m_e
  342.                _F_o_n_t_N_a_m_e is the name of  a  font  to  use  for  drawing
  343.                characters.   It  may have any of the forms accepted by
  344.                TTTTkkkk____GGGGeeeettttFFFFoooonnnnttttSSSSttttrrrruuuucccctttt.
  345.  
  346.           ----ffffoooorrrreeeeggggrrrroooouuuunnnndddd _c_o_l_o_r
  347.                _C_o_l_o_r specifies the color to use when drawing text  and
  348.                other  foreground  information  such as underlines.  It
  349.                may have any of the forms accepted by TTTTkkkk____GGGGeeeettttCCCCoooolllloooorrrr.
  350.  
  351.           ----rrrreeeelllliiiieeeeffff _r_e_l_i_e_f
  352.                _R_e_l_i_e_f _s_p_e_c_i_f_i_e_s _t_h_e _3-_D  _r_e_l_i_e_f  _t_o  _u_s_e  _f_o_r  _d_r_a_w_i_n_g
  353.                _b_a_c_k_g_r_o_u_n_d_s,   _i_n   _a_n_y   _o_f   _t_h_e  _f_o_r_m_s  _a_c_c_e_p_t_e_d  _b_y
  354.                TTTTkkkk____GGGGeeeettttRRRReeeelllliiiieeeeffff.  This option is used in conjunction  with
  355.                the ----bbbboooorrrrddddeeeerrrrwwwwiiiiddddtttthhhh option to give a 3-D appearance to the
  356.                background for characters; it  is  ignored  unless  the
  357.                ----bbbbaaaacccckkkkggggrrrroooouuuunnnndddd option has been set for the tag.
  358.  
  359.           ----uuuunnnnddddeeeerrrrlllliiiinnnneeee _b_o_o_l_e_a_n
  360.                _B_o_o_l_e_a_n specifies whether or not to draw  an  underline
  361.                underneath  characters.   It  may have any of the forms
  362.                accepted by TTTTkkkk____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn.
  363.  
  364.           If a character has several tags associated with it,  and  if
  365.           their  display  options  conflict,  then  the options of the
  366.           highest priority tag are  used.   If  a  particular  display
  367.           option  hasn't been specified for a particular tag, or if it
  368.           is specified as an empty string, then that option will never
  369.           be  used;   the next-highest-priority tag's option will used
  370.           instead.  If no tag specifies a particular display  optionl,
  371.           then the default style for the widget will be used.
  372.  
  373.           The second purpose for tags  is  event  bindings.   You  can
  374.           associate  bindings  with a tag in much the same way you can
  375.           associate bindings with a widget class:  whenever particular
  376.           X events occur on characters with the given tag, a given Tcl
  377.           command will be executed.  Tag bindings can be used to  give
  378.           behaviors  to ranges of characters; among other things, this
  379.           allows  hypertext-like  features  to  be  implemented.   For
  380.           details,  see the description of the ttttaaaagggg bbbbiiiinnnndddd widget command
  381.           below.
  382.  
  383.           The third use for tags is in managing  the  selection.   See
  384.           THE SELECTION below.
  385.  
  386.  
  387.      MMMMAAAARRRRKKKKSSSS
  388.           The second form of annotation in text  widgets  is  a  mark.
  389.           Marks  are used for remembering particular places in a text.
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 7/23/95)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  401.  
  402.  
  403.  
  404.           They are something like tags, in that they  have  names  and
  405.           they  refer  to  places  in  the  file,  but  a  mark  isn't
  406.           associated with particular characters.  Instead, a  mark  is
  407.           associated  with  the  gap  between  two characters.  Only a
  408.           single position may be associated with a mark at  any  given
  409.           time.   If the characters around a mark are deleted the mark
  410.           will  still  remain;   it  will  just  have   new   neighbor
  411.           characters.  In contrast, if the characters containing a tag
  412.           are deleted then the tag will no longer have an  association
  413.           with  characters in the file.  Marks may be manipulated with
  414.           the ``_p_a_t_h_N_a_m_e mmmmaaaarrrrkkkk''  widget  command,  and  their  current
  415.           locations  may  be  determined  by using the mark name as an
  416.           index in widget commands.
  417.  
  418.           The name space for marks is different from  that  for  tags:
  419.           the  same  name  may  be used for both a mark and a tag, but
  420.           they will refer to different things.
  421.  
  422.           Two marks have special significance.  First, the mark iiiinnnnsssseeeerrrrtttt
  423.           is  associated with the insertion cursor, as described under
  424.           THE INSERTION CURSOR below.  Second,  the  mark  ccccuuuurrrrrrrreeeennnntttt  is
  425.           associated  with  the  character closest to the mouse and is
  426.           adjusted automatically to track the mouse position  and  any
  427.           changes  to  the text in the widget (one exception:  ccccuuuurrrrrrrreeeennnntttt
  428.           is not updated in response  to  mouse  motions  if  a  mouse
  429.           button is down;  the update will be deferred until all mouse
  430.           buttons have been released).  Neither of these special marks
  431.           may be unset.
  432.  
  433.  
  434.      WWWWIIIINNNNDDDDOOOOWWWWSSSS
  435.           The third form of annotation in text widgets  is  a  window.
  436.           Window support isn't implemented yet, but when it is it will
  437.           be described here.
  438.  
  439.  
  440.      TTTTHHHHEEEE SSSSEEEELLLLEEEECCCCTTTTIIIIOOOONNNN
  441.           Text widgets support the standard  X  selection.   Selection
  442.           support  is  implemented  via  tags.  If the eeeexxxxppppoooorrrrttttSSSSeeeelllleeeeccccttttiiiioooonnnn
  443.           option for the text widget is true then the sssseeeellll tag will  be
  444.           associated with the selection:
  445.  
  446.           [1]  Whenever characters are tagged with sssseeeellll the text widget
  447.                will claim ownership of the selection.
  448.  
  449.           [2]  Attempts to retrieve the selection will be serviced  by
  450.                the  text  widget, returning all the charaters with the
  451.                sssseeeellll tag.
  452.  
  453.           [3]  If the selection is claimed away by another application
  454.                or  by another window within this application, then the
  455.                sssseeeellll tag will be removed  from  all  characters  in  the
  456.  
  457.  
  458.  
  459.      Page 7                                          (printed 7/23/95)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  467.  
  468.  
  469.  
  470.                text.
  471.  
  472.           The sssseeeellll tag is automatically defined when a text  widget  is
  473.           created,  and  it may not be deleted with the ``_p_a_t_h_N_a_m_e ttttaaaagggg
  474.           ddddeeeelllleeeetttteeee'' widget command.  Furthermore, the sssseeeelllleeeeccccttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd,
  475.           sssseeeelllleeeeccccttttBBBBoooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh, and sssseeeelllleeeeccccttttFFFFoooorrrreeeeggggrrrroooouuuunnnndddd options for the text
  476.           widget  are  tied  to  the  ----bbbbaaaacccckkkkggggrrrroooouuuunnnndddd,  ----bbbboooorrrrddddeeeerrrrwwwwiiiiddddtttthhhh,  and
  477.           ----ffffoooorrrreeeeggggrrrroooouuuunnnndddd options for the sssseeeellll tag:  changes in either will
  478.           automatically be reflected in the other.
  479.  
  480.  
  481.      TTTTHHHHEEEE IIIINNNNSSSSEEEERRRRTTTTIIIIOOOONNNN CCCCUUUURRRRSSSSOOOORRRR
  482.           The mark named  iiiinnnnsssseeeerrrrtttt  has  special  significance  in  text
  483.           widgets.   It is defined automatically when a text widget is
  484.           created and it may not be unset  with  the  ``_p_a_t_h_N_a_m_e  mmmmaaaarrrrkkkk
  485.           uuuunnnnsssseeeetttt''  widget  command.   The  iiiinnnnsssseeeerrrrtttt  mark represents the
  486.           position of the insertion cursor, and the  insertion  cursor
  487.           will  automatically be drawn at this point whenever the text
  488.           widget has the input focus.
  489.  
  490.  
  491.      WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  492.           The tttteeeexxxxtttt command creates a new Tcl command whose name is the
  493.           same  as  the  path name of the text's window.  This command
  494.           may be used to invoke various operations on the widget.   It
  495.           has the following general form:
  496.  
  497.                _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  498.           _P_a_t_h_N_a_m_e is the name of the command, which is  the  same  as
  499.           the  text widget's path name.  _O_p_t_i_o_n and the _a_r_gs determine
  500.           the exact behavior of the command.  The  following  commands
  501.           are possible for text widgets:
  502.  
  503.           _p_a_t_h_N_a_m_e ccccoooommmmppppaaaarrrreeee _i_n_d_e_x_1 _o_p _i_n_d_e_x_2
  504.                Compares  the  indices  given  by  _i_n_d_e_x_1  and   _i_n_d_e_x_2
  505.                according  to  the relational operator given by _o_p, and
  506.                returns 1 if the relationship is satisfied and 0 if  it
  507.                isn't.   _O_p must be one of the operators <, <=, ==, >=,
  508.                >, or !=.  If _o_p is == then 1 is returned  if  the  two
  509.                indices  refer to the same character, if _o_p is < then 1
  510.                is returned if _i_n_d_e_x_1 refers to an earlier character in
  511.                the text than _i_n_d_e_x_2, and so on.
  512.  
  513.           _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  514.                Query  or  modify  the  configuration  options  of  the
  515.                widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  516.                describing all of the available  options  for  _p_a_t_h_N_a_m_e
  517.                (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of
  518.                this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  519.                the  command  returns  a  list describing the one named
  520.                option  (this   list   will   be   identical   to   the
  521.                corresponding  sublist  of  the  value  returned  if no
  522.  
  523.  
  524.      Page 8                                          (printed 7/23/95)
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  532.  
  533.  
  534.  
  535.                _o_p_t_i_o_n is specified).   If  one  or  more  _o_p_t_i_o_n-_v_a_l_u_e
  536.                pairs  are  specified,  then  the  command modifies the
  537.                given widget option(s) to have the given value(s);   in
  538.                this  case the command returns an empty string.  _O_p_t_i_o_n
  539.                may have  any  of  the  values  accepted  by  the  tttteeeexxxxtttt
  540.                command.
  541.  
  542.           _p_a_t_h_N_a_m_e ddddeeeebbbbuuuugggg ?_b_o_o_l_e_a_n?
  543.                If _b_o_o_l_e_a_n is specified, then it must have one  of  the
  544.                true  or  false  values accepted by Tcl_GetBoolean.  If
  545.                the value is  a  true  one  then  internal  consistency
  546.                checks  will be turned on in the B-tree code associated
  547.                with text widgets.  If _b_o_o_l_e_a_n has a false  value  then
  548.                the  debugging  checks  will  be turned off.  In either
  549.                case the command returns an empty string.   If  _b_o_o_l_e_a_n
  550.                is  not specified then the command returns oooonnnn or ooooffffffff to
  551.                indicate whether or not debugging is turned on.   There
  552.                is  a  single  debugging  switch  shared  by  all  text
  553.                widgets:  turning debugging on or  off  in  any  widget
  554.                turns  it  on or off for all widgets.  For widgets with
  555.                large amounts of text, the consistency checks may cause
  556.                a noticeable slow-down.
  557.  
  558.           _p_a_t_h_N_a_m_e ddddeeeelllleeeetttteeee _i_n_d_e_x_1 ?_i_n_d_e_x_2?
  559.                Delete a range of characters from the  text.   If  both
  560.                _i_n_d_e_x_1  and  _i_n_d_e_x_2  are specified, then delete all the
  561.                characters starting with the one given  by  _i_n_d_e_x_1  and
  562.                stopping  just  before  _i_n_d_e_x_2  (i.e.  the character at
  563.                _i_n_d_e_x_2 is not deleted).  If _i_n_d_e_x_2  doesn't  specify  a
  564.                position   later  in  the  text  than  _i_n_d_e_x_1  then  no
  565.                characters are deleted.  If _i_n_d_e_x_2 isn't specified then
  566.                the  single  character at _i_n_d_e_x_1 is deleted.  It is not
  567.                allowable to delete characters  in  a  way  that  would
  568.                leave the text without a newline as the last character.
  569.                The command returns an empty string.
  570.  
  571.           _p_a_t_h_N_a_m_e ggggeeeetttt _i_n_d_e_x_1 ?_i_n_d_e_x_2?
  572.                Return a range of characters from the text.  The return
  573.                value  will  be all the characters in the text starting
  574.                with the one whose index  is  _i_n_d_e_x_1  and  ending  just
  575.                before  the one whose index is _i_n_d_e_x_2 (the character at
  576.                _i_n_d_e_x_2 will not be returned).   If  _i_n_d_e_x_2  is  omitted
  577.                then  the  single  character at _i_n_d_e_x_1 is returned.  If
  578.                there are no characters in the  specified  range  (e.g.
  579.                _i_n_d_e_x_1  is  past  the end of the file or _i_n_d_e_x_2 is less
  580.                than or equal  to  _i_n_d_e_x_1)  then  an  empty  string  is
  581.                returned.
  582.  
  583.           _p_a_t_h_N_a_m_e iiiinnnnddddeeeexxxx _i_n_d_e_x
  584.                Returns the position corresponding to _i_n_d_e_x in the form
  585.                _l_i_n_e._c_h_a_r where _l_i_n_e is the line number and _c_h_a_r is the
  586.                character number.  _I_n_d_e_x may  have  any  of  the  forms
  587.  
  588.  
  589.  
  590.      Page 9                                          (printed 7/23/95)
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  598.  
  599.  
  600.  
  601.                described under INDICES above.
  602.  
  603.           _p_a_t_h_N_a_m_e iiiinnnnsssseeeerrrrtttt _i_n_d_e_x _c_h_a_r_s
  604.                Inserts _c_h_a_r_s into the text just before  the  character
  605.                at  _i_n_d_e_x  and  returns  an  empty  string.   It is not
  606.                possible to insert characters after the last newline of
  607.                the text.
  608.  
  609.           _p_a_t_h_N_a_m_e mmmmaaaarrrrkkkk _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  610.                This command is used to manipulate  marks.   The  exact
  611.                behavior  of the command depends on the _o_p_t_i_o_n argument
  612.                that follows the mmmmaaaarrrrkkkk argument.  The following forms of
  613.                the command are currently supported:
  614.  
  615.                _p_a_t_h_N_a_m_e mmmmaaaarrrrkkkk nnnnaaaammmmeeeessss
  616.                     Returns a list whose elements are the names of all
  617.                     the marks that are currently set.
  618.  
  619.                _p_a_t_h_N_a_m_e mmmmaaaarrrrkkkk sssseeeetttt _m_a_r_k_N_a_m_e _i_n_d_e_x
  620.                     Sets the mark named _m_a_r_k_N_a_m_e to  a  position  just
  621.                     before   the  character  at  _i_n_d_e_x.   If  _m_a_r_k_N_a_m_e
  622.                     already exists, it is moved from its old position;
  623.                     if  it doesn't exist, a new mark is created.  This
  624.                     command returns an empty string.
  625.  
  626.                _p_a_t_h_N_a_m_e mmmmaaaarrrrkkkk uuuunnnnsssseeeetttt _m_a_r_k_N_a_m_e ?_m_a_r_k_N_a_m_e _m_a_r_k_N_a_m_e ...?
  627.                     Remove the  mark  corresponding  to  each  of  the
  628.                     _m_a_r_k_N_a_m_e arguments.  The removed marks will not be
  629.                     usable in indices and  will  not  be  returned  by
  630.                     future  calls  to  ``_p_a_t_h_N_a_m_e  mmmmaaaarrrrkkkk nnnnaaaammmmeeeessss''.  This
  631.                     command returns an empty string.
  632.  
  633.           _p_a_t_h_N_a_m_e ssssccccaaaannnn _o_p_t_i_o_n _a_r_g_s
  634.                This command is used to implement  scanning  on  texts.
  635.                It has two forms, depending on _o_p_t_i_o_n:
  636.  
  637.                _p_a_t_h_N_a_m_e ssssccccaaaannnn mmmmaaaarrrrkkkk _y
  638.                     Records _y and the current view in the text window;
  639.                     used   in   conjunction  with  later  ssssccccaaaannnn  ddddrrrraaaaggggttttoooo
  640.                     commands.  Typically this  command  is  associated
  641.                     with  a  mouse  button  press  in  the widget.  It
  642.                     returns an empty string.
  643.  
  644.                _p_a_t_h_N_a_m_e ssssccccaaaannnn ddddrrrraaaaggggttttoooo _y
  645.                     This command computes the difference between its _y
  646.                     argument  and the _y argument to the last ssssccccaaaannnn mmmmaaaarrrrkkkk
  647.                     command for the widget.  It then adjusts the  view
  648.                     up  or  down  by  10  times  the  difference in y-
  649.                     coordinates.  This command is typically associated
  650.                     with mouse motion events in the widget, to produce
  651.                     the effect of dragging  the  text  at  high  speed
  652.                     through  the window.  The return value is an empty
  653.  
  654.  
  655.  
  656.      Page 10                                         (printed 7/23/95)
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  664.  
  665.  
  666.  
  667.                     string.
  668.  
  669.           _p_a_t_h_N_a_m_e ttttaaaagggg _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  670.                This command is used to  manipulate  tags.   The  exact
  671.                behavior  of the command depends on the _o_p_t_i_o_n argument
  672.                that follows the ttttaaaagggg argument.  The following forms  of
  673.                the command are currently supported:
  674.  
  675.                _p_a_t_h_N_a_m_e ttttaaaagggg aaaadddddddd _t_a_g_N_a_m_e _i_n_d_e_x_1 ?_i_n_d_e_x_2?
  676.                     Associate  the  tag  _t_a_g_N_a_m_e  with  all   of   the
  677.                     characters  starting  with  _i_n_d_e_x_1 and ending just
  678.                     before  _i_n_d_e_x_2  (the  character  at  _i_n_d_e_x_2  isn't
  679.                     tagged).   If  _i_n_d_e_x_2  is  omitted then the single
  680.                     character at _i_n_d_e_x_1 is tagged.  If  there  are  no
  681.                     characters  in the specified range (e.g. _i_n_d_e_x_1 is
  682.                     past the end of the file or _i_n_d_e_x_2 is less than or
  683.                     equal  to  _i_n_d_e_x_1) then the command has no effect.
  684.                     This command returns an empty string.
  685.  
  686.                _p_a_t_h_N_a_m_e ttttaaaagggg bbbbiiiinnnndddd _t_a_g_N_a_m_e ?_s_e_q_u_e_n_c_e? ?_c_o_m_m_a_n_d?
  687.                     This command associates _c_o_m_m_a_n_d with the tag given
  688.                     by  _t_a_g_N_a_m_e.  Whenever the event sequence given by
  689.                     _s_e_q_u_e_n_c_e occurs for  a  character  that  has  been
  690.                     tagged  with _t_a_g_N_a_m_e, the command will be invoked.
  691.                     This widget command is similar to the bbbbiiiinnnndddd command
  692.                     except  that  it  operates on characters in a text
  693.                     rather than entire widgets.  See the  bbbbiiiinnnndddd  manual
  694.                     entry  for  complete  details  on  the  syntax  of
  695.                     _s_e_q_u_e_n_c_e  and  the  substitutions   performed   on
  696.                     _c_o_m_m_a_n_d  before invoking it.  If all arguments are
  697.                     specified then a new binding is created, replacing
  698.                     any  existing  binding  for  the same _s_e_q_u_e_n_c_e and
  699.                     _t_a_g_N_a_m_e (if the  first  character  of  _c_o_m_m_a_n_d  is
  700.                     ``+''  then  _c_o_m_m_a_n_d  augments an existing binding
  701.                     rather than  replacing  it).   In  this  case  the
  702.                     return  value  is  an empty string.  If _c_o_m_m_a_n_d is
  703.                     omitted  then  the  command  returns  the  _c_o_m_m_a_n_d
  704.                     associated  with  _t_a_g_N_a_m_e  and  _s_e_q_u_e_n_c_e (an error
  705.                     occurs if there is  no  such  binding).   If  both
  706.                     _c_o_m_m_a_n_d  and _s_e_q_u_e_n_c_e are omitted then the command
  707.                     returns a list of  all  the  sequences  for  which
  708.                     bindings have been defined for _t_a_g_N_a_m_e.
  709.  
  710.                     The  only  events  for  which  bindings   may   be
  711.                     specified  are  those  related  to  the  mouse and
  712.                     keyboard,  such  as  EEEEnnnntttteeeerrrr,  LLLLeeeeaaaavvvveeee,   BBBBuuuuttttttttoooonnnnPPPPrrrreeeessssssss,
  713.                     MMMMoooottttiiiioooonnnn,  and  KKKKeeeeyyyyPPPPrrrreeeessssssss.  Event bindings for a text
  714.                     widget use the ccccuuuurrrrrrrreeeennnntttt mark described under  MARKS
  715.                     above.   EEEEnnnntttteeeerrrr events trigger for a character when
  716.                     it becomes the current character (i.e. the ccccuuuurrrrrrrreeeennnntttt
  717.                     mark  moves  to  just in front of that character).
  718.                     LLLLeeeeaaaavvvveeee events  trigger  for  a  character  when  it
  719.  
  720.  
  721.  
  722.      Page 11                                         (printed 7/23/95)
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  730.  
  731.  
  732.  
  733.                     ceases  to  be  the current item (i.e. the ccccuuuurrrrrrrreeeennnntttt
  734.                     mark  moves  away  from  that  character,  or  the
  735.                     character is deleted).  These events are different
  736.                     than EEEEnnnntttteeeerrrr and LLLLeeeeaaaavvvveeee events  for  windows.   Mouse
  737.                     and  keyboard  events  are directed to the current
  738.                     character.
  739.  
  740.                     It is possible for the current character  to  have
  741.                     multiple  tags,  and  for  each  of them to have a
  742.                     binding for a  particular  event  sequence.   When
  743.                     this occurs, the binding from the highest priority
  744.                     tag is used.  If a particular tag doesn't  have  a
  745.                     binding  that  matches  an  event, then the tag is
  746.                     ignored and  tags  with  lower  priority  will  be
  747.                     checked.
  748.  
  749.                     If bindings are created for the widget as a  whole
  750.                     using  the  bbbbiiiinnnndddd command, then those bindings will
  751.                     supplement the tag bindings.  This  means  that  a
  752.                     single  event can trigger two Tcl scripts, one for
  753.                     a widget-level binding and  one  for  a  tag-level
  754.                     binding.
  755.  
  756.                _v_a_l_u_e ...?
  757.                _p_a_t_h_N_a_m_e ttttaaaagggg  ccccoooonnnnffffiiiigggguuuurrrreeee  _t_a_g_N_a_m_e  ?_o_p_t_i_o_n?  ?_v_a_l_u_e?  ?_o_p_t_i_o_n
  758.                     This  command  is  similar to the ccccoooonnnnffffiiiigggguuuurrrreeee widget
  759.                     command except that it modifies options associated
  760.                     with the tag given by _t_a_g_N_a_m_e instead of modifying
  761.                     options for the overall text widget.  If no _o_p_t_i_o_n
  762.                     is   specified,   the   command   returns  a  list
  763.                     describing  all  of  the  available  options   for
  764.                     _t_a_g_N_a_m_e  (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on
  765.                     the format of this list).  If _o_p_t_i_o_n is  specified
  766.                     with  no  _v_a_l_u_e,  then  the command returns a list
  767.                     describing the one named option (this list will be
  768.                     identical  to  the  corresponding  sublist  of the
  769.                     value returned if no _o_p_t_i_o_n is specified).  If one
  770.                     or more _o_p_t_i_o_n-_v_a_l_u_e pairs are specified, then the
  771.                     command modifies the given option(s) to  have  the
  772.                     given  value(s)  in  _t_a_g_N_a_m_e;  in  this  case  the
  773.                     command returns an empty string.  See  TAGS  above
  774.                     for details on the options available for tags.
  775.  
  776.                _p_a_t_h_N_a_m_e ttttaaaagggg ddddeeeelllleeeetttteeee _t_a_g_N_a_m_e ?_t_a_g_N_a_m_e ...?
  777.                     Deletes  all  tag  information  for  each  of  the
  778.                     _t_a_g_N_a_m_e  arguments.   The command removes the tags
  779.                     from all characters in the file and  also  deletes
  780.                     any  other  information  associated with the tags,
  781.                     such as bindings  and  display  information.   The
  782.                     command returns an empty string.
  783.  
  784.                _p_a_t_h_N_a_m_ettttaaaagggg lllloooowwwweeeerrrr _t_a_g_N_a_m_e ?_b_e_l_o_w_T_h_i_s?
  785.  
  786.  
  787.  
  788.      Page 12                                         (printed 7/23/95)
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  796.  
  797.  
  798.  
  799.                     Changes the priority of tag _t_a_g_N_a_m_e so that it  is
  800.                     just  lower in priority than the tag whose name is
  801.                     _b_e_l_o_w_T_h_i_s.   If   _b_e_l_o_w_T_h_i_s   is   omitted,   then
  802.                     _t_a_g_N_a_m_e's  priority  is  changed to make it lowest
  803.                     priority of all tags.
  804.  
  805.                _p_a_t_h_N_a_m_e ttttaaaagggg nnnnaaaammmmeeeessss ?_i_n_d_e_x?
  806.                     Returns a list whose elements are the names of all
  807.                     the tags that are active at the character position
  808.                     given by _i_n_d_e_x.  If _i_n_d_e_x  is  omitted,  then  the
  809.                     return  value  will  describe all of the tags that
  810.                     exist for the text (this includes  all  tags  that
  811.                     have  been  named  in  a  ``_p_a_t_h_N_a_m_e  ttttaaaagggg'' widget
  812.                     command but haven't been deleted by  a  ``_p_a_t_h_N_a_m_e
  813.                     ttttaaaagggg ddddeeeelllleeeetttteeee'' widget command, even if no characters
  814.                     are currently marked with the tag).  The list will
  815.                     be sorted in order from lowest priority to highest
  816.                     priority.
  817.  
  818.                _p_a_t_h_N_a_m_e ttttaaaagggg nnnneeeexxxxttttrrrraaaannnnggggeeee _t_a_g_N_a_m_e _i_n_d_e_x_1 ?_i_n_d_e_x_2?
  819.                     This command searches the  text  for  a  range  of
  820.                     characters  tagged  with  _t_a_g_N_a_m_e  where the first
  821.                     character of the range  is  no  earlier  than  the
  822.                     character   at   _i_n_d_e_x_1  and  no  later  than  the
  823.                     character just before _i_n_d_e_x_2 (a range starting  at
  824.                     _i_n_d_e_x_2   will  not  be  considered).   If  several
  825.                     matching ranges exist, the first  one  is  chosen.
  826.                     The  command's  return  value is a list containing
  827.                     two elements, which are the  index  of  the  first
  828.                     character  of  the  range  and  the  index  of the
  829.                     character just after the last one  in  the  range.
  830.                     If  no  matching  range  is  found then the return
  831.                     value is an empty string.  If _i_n_d_e_x_2 is not  given
  832.                     then it defaults to the end of the text.
  833.  
  834.                _p_a_t_h_N_a_m_ettttaaaagggg rrrraaaaiiiisssseeee _t_a_g_N_a_m_e ?_a_b_o_v_e_T_h_i_s?
  835.                     Changes the priority of tag _t_a_g_N_a_m_e so that it  is
  836.                     just higher in priority than the tag whose name is
  837.                     _a_b_o_v_e_T_h_i_s.   If   _a_b_o_v_e_T_h_i_s   is   omitted,   then
  838.                     _t_a_g_N_a_m_e's  priority  is changed to make it highest
  839.                     priority of all tags.
  840.  
  841.                _p_a_t_h_N_a_m_e ttttaaaagggg rrrraaaannnnggggeeeessss _t_a_g_N_a_m_e
  842.                     Returns a list describing all  of  the  ranges  of
  843.                     text  that  have  been  tagged  with _t_a_g_N_a_m_e.  The
  844.                     first two elements of the list describe the  first
  845.                     tagged  range  in  the text, the next two elements
  846.                     describe the second range, and so on.   The  first
  847.                     element  of  each  pair  contains the index of the
  848.                     first character  of  the  range,  and  the  second
  849.                     element  of  the  pair  contains  the index of the
  850.                     character just after the last one  in  the  range.
  851.  
  852.  
  853.  
  854.      Page 13                                         (printed 7/23/95)
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  862.  
  863.  
  864.  
  865.                     If there are no characters tagged with _t_a_g then an
  866.                     empty string is returned.
  867.  
  868.                _p_a_t_h_N_a_m_e ttttaaaagggg rrrreeeemmmmoooovvvveeee _t_a_g_N_a_m_e _i_n_d_e_x_1 ?_i_n_d_e_x_2?
  869.                     Remove the tag _t_a_g_N_a_m_e from all of the  characters
  870.                     starting  at  _i_n_d_e_x_1 and ending just before _i_n_d_e_x_2
  871.                     (the character  at  _i_n_d_e_x_2  isn't  affected).   If
  872.                     _i_n_d_e_x_2  is  omitted  then  the single character at
  873.                     _i_n_d_e_x_1 is untagged.  If there are no characters in
  874.                     the  specified  range (e.g. _i_n_d_e_x_1 is past the end
  875.                     of the file or _i_n_d_e_x_2 is less  than  or  equal  to
  876.                     _i_n_d_e_x_1)  then  the  command  has  no effect.  This
  877.                     command returns an empty string.
  878.  
  879.           _p_a_t_h_N_a_m_e yyyyvvvviiiieeeewwww ?----ppppiiiicccckkkkppppllllaaaacccceeee? _w_h_a_t
  880.                This command changes the view in the widget's window so
  881.                that  the  line given by _w_h_a_t is visible in the window.
  882.                _W_h_a_t may be either an absolute  line  number,  where  0
  883.                corresponds  to the first line of the file, or an index
  884.                with any of the forms described  under  INDICES  above.
  885.                The  first  form  (absolute line number) is used in the
  886.                commands issued by scrollbars to control  the  widget's
  887.                view.   If  the  ----ppppiiiicccckkkkppppllllaaaacccceeee option isn't specified then
  888.                _w_h_a_t  will  appear  at  the  top  of  the  window.   If
  889.                ----ppppiiiicccckkkkppppllllaaaacccceeee  is  specified then the widget chooses where
  890.                _w_h_a_t appears in the window:
  891.  
  892.                [1]  If _w_h_a_t is already visible somewhere in the window
  893.                     then the command does nothing.
  894.  
  895.                [2]  If _w_h_a_t is only a few lines off-screen  above  the
  896.                     window  then  it  will be positioned at the top of
  897.                     the window.
  898.  
  899.                [3]  If _w_h_a_t is only a few lines off-screen  below  the
  900.                     window then it will be positioned at the bottom of
  901.                     the window.
  902.  
  903.                [4]  Otherwise, _w_h_a_t will be centered in the window.
  904.  
  905.                The ----ppppiiiicccckkkkppppllllaaaacccceeee option is typically used after inserting
  906.                text  to  make  sure that the insertion cursor is still
  907.                visible on the screen.  This command returns  an  empty
  908.                string.
  909.  
  910.  
  911.      BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  912.           Tk automatically creates class bindings for texts that  give
  913.           them the following default behavior:
  914.  
  915.           [1]  Pressing mouse  button  1  in  an  text  positions  the
  916.                insertion  cursor  just before the character underneath
  917.  
  918.  
  919.  
  920.      Page 14                                         (printed 7/23/95)
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  928.  
  929.  
  930.  
  931.                the mouse cursor and  sets  the  input  focus  to  this
  932.                widget.
  933.  
  934.           [2]  Dragging with mouse button 1 strokes  out  a  selection
  935.                between  the  insertion  cursor and the character under
  936.                the mouse.
  937.  
  938.           [3]  If you double-press mouse button 1 then the word  under
  939.                the mouse cursor will be selected, the insertion cursor
  940.                will be positioned at the beginning of  the  word,  and
  941.                dragging  the  mouse  will stroke out a selection whole
  942.                words at a time.
  943.  
  944.           [4]  If you triple-press mouse button 1 then the line  under
  945.                the mouse cursor will be selected, the insertion cursor
  946.                will be positioned at the beginning of  the  line,  and
  947.                dragging  the  mouse  will stroke out a selection whole
  948.                line at a time.
  949.  
  950.           [5]  The ends of the selection can be adjusted  by  dragging
  951.                with  mouse button 1 while the shift key is down;  this
  952.                will adjust the end of the selection that  was  nearest
  953.                to  the mouse cursor when button 1 was pressed.  If the
  954.                selection was made in word or line mode then it will be
  955.                adjusted in this same mode.
  956.  
  957.           [6]  The view in the text can be adjusted by  dragging  with
  958.                mouse button 2.
  959.  
  960.           [7]  If the input focus is in a text widget  and  characters
  961.                are  typed on the keyboard, the characters are inserted
  962.                just before the insertion cursor.
  963.  
  964.           [8]  Control+h and the Backspace and Delete keys  erase  the
  965.                character just before the insertion cursor.
  966.  
  967.           [9]  Control+v inserts the current selection just before the
  968.                insertion cursor.
  969.  
  970.           [10] Control+d deletes the selected  characters;   an  error
  971.                occurs if the selection is not in this widget.
  972.  
  973.           If the text is disabled using the  ssssttttaaaatttteeee  option,  then  the
  974.           text's  view  can still be adjusted and text in the text can
  975.           still be selected, but no insertion cursor will be displayed
  976.           and no text modifications will take place.
  977.  
  978.           The behavior  of  texts  can  be  changed  by  defining  new
  979.           bindings  for  individual widgets or by redefining the class
  980.           bindings.
  981.  
  982.  
  983.  
  984.  
  985.  
  986.      Page 15                                         (printed 7/23/95)
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.      tttteeeexxxxtttt((((nnnn))))                      TTTTkkkk (((( ))))                       tttteeeexxxxtttt((((nnnn))))
  994.  
  995.  
  996.  
  997.      PPPPEEEERRRRFFFFOOOORRRRMMMMAAAANNNNCCCCEEEE IIIISSSSSSSSUUUUEEEESSSS
  998.           Text widgets should  run  efficiently  under  a  variety  of
  999.           conditions.   The  text  widget uses about 2-3 bytes of main
  1000.           memory for each byte of text, so texts containing a megabyte
  1001.           or  more  should be practical on most workstations.  Text is
  1002.           represented internally with a modified B-tree structure that
  1003.           makes operations relatively efficient even with large texts.
  1004.           Tags are included in the B-tree  structure  in  a  way  that
  1005.           allows  tags  to  span  large  ranges  or have many disjoint
  1006.           smaller ranges without loss of efficiency.  Marks  are  also
  1007.           implemented  in  a  way  that allows large numbers of marks.
  1008.           The only known mode of operation where a text widget may not
  1009.           run  efficiently  is  if  it  has  a  very  large  number of
  1010.           different tags.  Hundreds of tags should be fine, or even  a
  1011.           thousand,  but  tens  of  thousands  of tags will make texts
  1012.           consume a lot of memory and run slowly.
  1013.  
  1014.  
  1015.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  1016.           text, widget
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.      Page 16                                         (printed 7/23/95)
  1053.  
  1054.  
  1055.  
  1056.